﻿@model PagedList.IPagedList<SIBI.Models.BienInformatico>
@using SIBI.Helpers
@{
    ViewBag.Title = "MovimientoPréstamo";
}

<h2>Movimiento Préstamo</h2>

<script src="@Url.Content("~/Scripts/myScript2.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.ui.autocomplete.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/myScript7.js")" type="text/javascript"></script>

@ViewBag.msnCorreo

     @using (Html.BeginForm()){   

            <table width="100%">
                    <tr>
                        <td>   
                            Serial:<br /> @Html.TextBox("SearchSerial", ViewBag.CurrentSerial as string) &nbsp;
                        </td>
                        <td>
                            <div id="DialogMovimientoPrestamoTipoBien" title="Tipo de Bienes"></div><br />
                            Tipo Bien:<br /> @Html.TextBox("SearchTipo", ViewBag.CurrentTipo as string)<br /> &nbsp;
                        </td> 
                        <td>   
                            Clase Objeto:<br /> @Html.TextBox("SearchClaseObjeto", ViewBag.CurrentObj as string) &nbsp;
                        </td> 
                    </tr>
                    <tr>
                        <td>
                            N° Anexo/Factura: <br /> @Html.TextBox("SearchUbi", ViewBag.CurrentUbi as string) &nbsp;
                        </td>                      
                    </tr>
            </table>
         <input type="submit" value="Filtrar" />
    }
<table  width="100%">
    <tr>
        <th>
            Número Serial
        </th>
        <th>
            Estado
        </th>
        <th>
            Tipo Bien
        </th>
        <th>
            Cargo
        </th>
        <th>
            Usuario
        </th>
        <th>
            Centro Costo 
        </th>
        <th>
            Modelo 
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.BienInformaticoId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nest.cnom)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ntib.cnom)
        </td>
        <td>
            @Html.UppercaseFirst(@Html.DisplayFor(modelItem => item.ncar.cdes).ToString())
        </td>
        <td>
            @Html.UppercaseFirst(@Html.DisplayFor(mmodelItem => item.ncar.empleados).ToString())
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ceco_id)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.nmym.ncob.cnom)
        </td>
        <td>
            @Html.ActionLink("Prestar", "PrestamoM", new { id = item.BienInformaticoId })
        </td>
    </tr>
}



</table>
<br />

<div>
    Pag @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    de @Model.PageCount
    &nbsp;
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<= ", "MovimientPrestamo", new { page = 1, currentSerial = ViewBag.CurrentSerial, currentTipo = ViewBag.CurrentTipo, currentUbi = ViewBag.CurrentUbi })
        @Html.Raw("&nbsp;");
        @Html.ActionLink("<=", "MovimientoPrestamo", new { page = Model.PageNumber - 1, currentSerial = ViewBag.CurrentSerial, currentTipo = ViewBag.CurrentTipo, currentUbi = ViewBag.CurrentUbi })
    }
    else
    {
        @:<<=
        @Html.Raw("&nbsp;");
        @:<=
    }
    &nbsp;
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("=>", "MovimientoPrestamo", new { page = Model.PageNumber + 1, currentSerial = ViewBag.CurrentSerial, currentTipo = ViewBag.CurrentTipo, currentUbi = ViewBag.CurrentUbi })
        @Html.Raw("&nbsp;");
        @Html.ActionLink(" =>>", "MovimientoPrestamo", new { page = Model.PageCount, currentSerial = ViewBag.CurrentSerial, currentTipo = ViewBag.CurrentTipo, currentUbi = ViewBag.CurrentUbi })
    }
    else
    {
        @:=>
        @Html.Raw("&nbsp;")
        @:=>>
    }
</div>